﻿Ext.grid.Panel.override({
    
    constructor: function(cfg)
    {
        var me = this;

        if (Ext.isString(cfg.termNode)) {
            cfg.termNode = Ext.uis.TermNode.get(cfg.termNode);
        }
        if (!cfg.store && cfg.termNode) {
            cfg.store = cfg.termNode.getStore();
        }
        this.callParent(arguments);

        //if (me.termNode) {
        //    me.termNode.applyToField(me);
        //}

        this.on('selectionchange', this.onActiveChange);
    },
    
    onActiveChange: function (item, selected)
    {
        if (this.store && selected.length) 
            this.store.setActiveRecords(selected);
    }

});